Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(locale): normalize science data #2886

Merged
merged 2 commits into from
May 11, 2024

Conversation

xDivisionByZerox
Copy link
Member

@xDivisionByZerox xDivisionByZerox commented May 8, 2024

Description

Follow-on to #2265.

Normalize the entries in the science module definitions in all locales. All locale files are untouched as every locale entry file is currently an export of a readonly array of objects. We ignore readonly arrays (from Object.freez) during normalization.

@xDivisionByZerox xDivisionByZerox added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs c: locale Permutes locale definitions m: science Something is referring to the science module labels May 8, 2024
@xDivisionByZerox xDivisionByZerox added this to the vAnytime milestone May 8, 2024
@xDivisionByZerox xDivisionByZerox requested a review from a team May 8, 2024 14:58
@xDivisionByZerox xDivisionByZerox self-assigned this May 8, 2024
@xDivisionByZerox xDivisionByZerox requested a review from a team as a code owner May 8, 2024 14:58
Copy link

netlify bot commented May 8, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 6ace688
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/663f77c7ac47660008949765
😎 Deploy Preview https://deploy-preview-2886.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.95%. Comparing base (fe76110) to head (6ace688).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2886      +/-   ##
==========================================
- Coverage   99.96%   99.95%   -0.01%     
==========================================
  Files        2977     2977              
  Lines      215466   215466              
  Branches      950      946       -4     
==========================================
- Hits       215380   215369      -11     
- Misses         86       97      +11     

see 2 files with indirect coverage changes

@ST-DDT ST-DDT requested a review from a team May 8, 2024 15:19
@xDivisionByZerox
Copy link
Member Author

Does freezing the locale entries here even make sense? Object.freeze only prevents the array instance from beeing mutated. Since all entries in the list are objects, wouldn't they profit more from being frozen instead?

@Shinigami92
Copy link
Member

Does freezing the locale entries here even make sense? Object.freeze only prevents the array instance from beeing mutated. Since all entries in the list are objects, wouldn't they profit more from being frozen instead?

I re-evaluated it and I'm a bit shocked as I thought that Object.freeze would be deep 🤔 but it's not

@ST-DDT ST-DDT enabled auto-merge (squash) May 11, 2024 13:51
@ST-DDT ST-DDT merged commit bbdd998 into next May 11, 2024
20 checks passed
@ST-DDT ST-DDT deleted the refactor/locale/normalize-science-data branch May 11, 2024 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: locale Permutes locale definitions c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: science Something is referring to the science module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants